package com.bike.bikeserver.controller.backend;

import com.bike.bikeserver.common.annotation.OperationLog;
import com.bike.bikeserver.common.core.domain.CommonResult;
import com.bike.bikeserver.service.IBikeDispatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @Author ZZX
 * @Date 2023/7/20 11:21
 */
@RestController
@RequestMapping("back/bikeDispatch")
public class BackBikeDispatchController
{
    @Autowired
    IBikeDispatchService bikeDispatchService;

    /**
     * 获取全部单车调度
     *
     * @return
     */
    @GetMapping("getBikeDispatchList")
    public CommonResult getBikeDispatchList()
    {
        return bikeDispatchService.getBikeDispatchList();
    }

    /**
     * 根据申请名精确获取调度信息
     *
     * @param dispatchApplier
     * @return
     */
    @OperationLog(value = "根据申请名精确获取调度信息:bike_dispatch")
    @GetMapping("getBackDispatchByNickNameBack")
    public CommonResult getBackDispatchByNickNameBack(@RequestParam("dispatchApplier") String dispatchApplier)
    {
        return bikeDispatchService.getBackDispatchByNickNameBack(dispatchApplier);
    }
}
